import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
	routes: [
		{
			path: "/",
			name: "index",
			component: resolve => require(["./pages/index"], resolve)
		},
		{
			path: "/patient/create",
			name: "patient-create",
			component: resolve => require(["./pages/patient/create"], resolve)
		},
		{
			path: "/patient/create/:clinicNumber",
			name: "patient-create",
			component: resolve => require(["./pages/patient/create"], resolve),
			props: true
		},
		{
			path: "/patient/edit/:id",
			name: "patient-edit",
			component: resolve => require(["./pages/patient/edit"], resolve),
			props: true
		},
		{
			path: "/patient/list",
			name: "patient-list",
			component: resolve => require(["./pages/patient/list"], resolve)
		},
		{
			path: "/patient/case-list/:patientId",
			name: "patient-case-list",
			props: true,
			component: resolve =>
				require(["./pages/case/patient-case-list"], resolve)
		},
		{
			path: "/case/create/:patientId",
			name: "case-create",
			props: true,
			component: resolve => require(["./pages/case/create"], resolve)
		},
		{
			path: "/case/detail/:id",
			name: "case-detail",
			props: true,
			component: resolve => require(["./pages/case/detail"], resolve)
		},
		{
			path: "/case/list",
			name: "case-list",
			component: resolve => require(["./pages/case/list"], resolve)
		}
	]
});
